<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

<%
	request.setAttribute("req", "request");
	pageContext.setAttribute("context", "pageContext");
	session.setAttribute("sess", "session");
	application.setAttribute("app", "application"); 
%>

<!-- 输出表达式方式 -->
<%
	String req = (String)request.getAttribute("req");
	String pc = (String)pageContext.getAttribute("context");
	String sess = (String)session.getAttribute("sess");
	String app = (String)application.getAttribute("app");
%>
<%=req %>
<br />
<%=pc %>
<br />
<%=sess %>
<br />
<%=app %>

<hr />

<!-- el表达式方式 -->
${requestScope.req }
<br />
${pageScope.context }
<br />
${sessionScope.sess }
<br />
${applicationScope.app }
<br />
<a href="testEl2.jsp">下一页</a>

</body>
</html>